/*   1:    */ package com.rinsi.core;
/*   2:    */ 
/*   3:    */ import com.rinsi.util.AssertUtil;
/*   4:    */ import com.rinsi.util.ListUtil;
/*   5:    */ import com.rinsi.util.MapUtil;
/*   6:    */ import java.util.HashMap;
/*   7:    */ import java.util.List;
/*   8:    */ import java.util.Map;
/*   9:    */ 
/*  10:    */ public class CoreCache
/*  11:    */ {
/*  12: 19 */   private static Map<String, Object> caches = new HashMap();
/*  13:    */   
/*  14:    */   public static void create(String key)
/*  15:    */   {
/*  16: 30 */     Map<String, Object> userCache = new HashMap();
/*  17:    */     
/*  18: 32 */     caches.put(key, userCache);
/*  19:    */   }
/*  20:    */   
/*  21:    */   public static Boolean hasCache(String key)
/*  22:    */   {
/*  23: 44 */     return Boolean.valueOf(caches.containsKey(key));
/*  24:    */   }
/*  25:    */   
/*  26:    */   public static void cache(String key, String index, Map<String, Object> data)
/*  27:    */   {
/*  28: 56 */     if (AssertUtil.isMapNotEmpty(data))
/*  29:    */     {
/*  30: 58 */       Map<String, Object> userCache = MapUtil.getMapData(caches, key);
/*  31:    */       
/*  32: 60 */       userCache.put(index, data);
/*  33:    */     }
/*  34:    */   }
/*  35:    */   
/*  36:    */   public static void cache(String key, String index, List<Map<String, Object>> datas)
/*  37:    */   {
/*  38: 73 */     if (AssertUtil.isCollectionNotEmpty(datas))
/*  39:    */     {
/*  40: 75 */       Map<String, Object> userCache = MapUtil.getMapData(caches, key);
/*  41:    */       
/*  42: 77 */       userCache.put(index, datas);
/*  43:    */     }
/*  44:    */   }
/*  45:    */   
/*  46:    */   public static Map<String, Object> getCacheMap(String key, String index)
/*  47:    */   {
/*  48: 90 */     Map<String, Object> userCache = MapUtil.getMapData(caches, key);
/*  49:    */     
/*  50: 92 */     return MapUtil.getMapData(userCache, index);
/*  51:    */   }
/*  52:    */   
/*  53:    */   public static List<Map<String, Object>> getCacheList(String key, String index)
/*  54:    */   {
/*  55:104 */     Map<String, Object> userCache = MapUtil.getMapData(caches, key);
/*  56:    */     
/*  57:106 */     return MapUtil.getListDatas(userCache, index);
/*  58:    */   }
/*  59:    */   
/*  60:    */   public static List<Map<String, Object>> getCacheList(String key, String index, String cond)
/*  61:    */   {
/*  62:119 */     Map<String, Object> userCache = MapUtil.getMapData(caches, key);
/*  63:    */     
/*  64:121 */     List rsList = MapUtil.getListDatas(userCache, index);
/*  65:    */     
/*  66:123 */     return ListUtil.subList(rsList, cond);
/*  67:    */   }
/*  68:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.core.CoreCache
 * JD-Core Version:    0.7.0.1
 */